package com.example.administrator.x2picturetransliteration.Http;

import com.example.administrator.x2picturetransliteration.Bean.HttpDataBean;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Url;
import rx.Observable;

/**
 * 请求接口
 * 2018/10/9.
 */

public interface BlogService {

    /**
     * 通用post请求
     */
    @Multipart
    @POST
    Observable<HttpDataBean> postHttpData(@Url String url,
                                          @Part("token")RequestBody token,
                                          @Part("channelCode")RequestBody channelCode,
                                          @PartMap Map<String, RequestBody> maps);

    /**
     * 文件上传
     * */
    @Multipart
    @POST
    Observable<HttpDataBean> postHttpFile(@Url String url,
                                          @Part("token")RequestBody token,
                                          @Part("channelCode")RequestBody channelCode,
                                          @Part List<MultipartBody.Part> partLis);

    @Multipart
    @POST
    Observable<HttpDataBean> postHttpFile(@Url String url,
                                          @Part("token")RequestBody token,
                                          @Part("channelCode")RequestBody channelCode,
                                          @Part MultipartBody.Part partLis);

    /**
     * 通用get请求
     */
    @GET
    Observable<HttpDataBean> getHttpData(@Url String url);


}
